<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>create a 2D map or a 3D scene(2D and 3D)</title>
    <style>
        html,body,#viewDiv {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }
    </style>
    <link rel="stylesheet" href="https://js.arcgis.com/4.17/esri/css/main.css">
    <script src="https://js.arcgis.com/4.17/"></script>
    <script>

        //2D

        // require(
        //     [
        //         "esri/Map",
        //         "esri/views/MapView"
        //     ],function(Map,MapView){
        //     var map = new Map({
        //         basemap:"topo-vector"
        //     });

        //     var view = new MapView({
        //         container:"viewDiv",
        //         map:map,
        //         center:[-118.805, 34.027],
        //         zoom:13
        //     })
        // })

        // 3D

        require(
            [
                "esri/Map",
                "esri/views/SceneView"
            ],function(Map,SceneView) {
                var map = new Map({
                    basemap:"topo-vector",
                    ground:"world-elevation"  //显示高程
                });
                 
                var view = new SceneView({
                    container:"viewDiv",
                    map:map,
                    camera: {
                        position: {
                            //观测点
                            x:-118.808,
                            y:33.961,
                            z:25000  //海拔高度（米）
                        },
                    tilt:65  //角度
                    }
                })
            }
        )
    </script>
</head>
<body>
    <div id="viewDiv"></div>
</body>
</html>